Correct generation of broken grabs
authorAlexander Larsson <alexl@redhat.com>
Thu, 27 Aug 2009 11:30:20 +0000 (13:30 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 27 Aug 2009 11:32:01 +0000 (13:32 +0200)
We send a broken grab when a *parent* gets unmapped, not when
a child gets unmapped!

gdk/gdkdisplay.c

index 2d094886ea79e0c6c21119b6c5f098ec5082a544..d22ff00c77fdfe534739d49e83280285f196af52 100644 (file)
@@ -1136,7 +1136,9 @@ _gdk_display_has_pointer_grab (GdkDisplay *display,
   return NULL;
 }
 
-/* Returns true if last grab was ended */
+/* Returns true if last grab was ended
+ * If if_child is non-NULL, end the grab only if the grabbed
+ * window is the same as if_child or a descendant of it */
 gboolean
 _gdk_display_end_pointer_grab (GdkDisplay *display,
                               gulong serial,
@@ -1154,7 +1156,7 @@ _gdk_display_end_pointer_grab (GdkDisplay *display,
   grab = l->data;
   if (grab &&
       (if_child == NULL ||
-       _gdk_window_event_parent_of (grab->window, if_child)))
+       _gdk_window_event_parent_of (if_child, grab->window)))
     {
       grab->serial_end = serial;
       grab->implicit_ungrab = implicit;